<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #div_test{
            background-color:aqua;
        }
        .class1{
            border:1px solid #ccc;
        }
        .class2{
            border:1px solid blue;
        }
        .class3{
            margin:50px;
        }
    </style>
</head>
<body>
    <div id="div_test" class="class1 class3">大家好，我是ES</div>
    <button id="btn_test">测试</button>
</body>
</html>
<script>
    let node =  document.getElementById("div_test");
    node.style.fontWeight = 'bold';
    console.log(node.className);
    document.getElementById("btn_test").addEventListener('click',()=>{
        //node.style.cssText="background-color:red;color:white;";
        node.style.backgroundColor='red';
        node.style.color='white';
        node.classList.add("class2");
        console.log(node.style);
    },false);
</script>